﻿@using QDT.Common
@using QDT.Core
@model IPagedList<QDT.Core.Payments.PaymentNotice>
@section HeadSection
{
    @Html.IncludeCSS("~/Content/Css/calendar.css")
    @Html.IncludeScript("~/Content/JS/calendar.js")
}
<div class="main_title">付款单列表</div>
<div class="blank5"></div>
<div class="search_row">
	<form name="search" action="@Url.Action("Notice")" method="get">	
	    订单号：<input type="text" class="textbox" name="orderSn" value="@Request.Params["orderSn"]" />
	    付款单号：<input type="text" class="textbox" name="noticeSn" value="@Request.Params["noticeSn"]" />
	    用户名：<input type="text" class="textbox" name="username" value="@Request.Params["username"]"/>
	    日期：<input type="text" class="textbox" id="createTime" name="createTime" value="@Request.Params["createTime"]" onfocus=" this.blur(); return showCalendar('createTime', '%Y-%m-%d', false, false, 'btn_CreateTime');" size="8"/>
        <input type="button" class="button" id="btn_CreateTime" value="选择时间" onclick=" return showCalendar('createTime', '%Y-%m-%d', false, false, 'btn_CreateTime'); " />
	    <input type="submit" class="button" value="搜索" />
	</form>
</div>
<div class="grid_box">
    <div class="grid_top">
    </div>
    @Html.Grid(Model).Columns(column =>
{
    column.CheckBox(x => x.ID);
    column.For(x => x.ID).Named("编号").HeaderAttributes(style => "width:50px;");
    column.For(x => x.NoticeSn).Named("付款单号").SortColumnName("NoticeSn");
    column.For(x => x.CreateTime).Named("创建时间").SortColumnName("CreateTime");
    column.For(x => x.PayTime??x.CreateTime).Named("支付时间").SortColumnName("PayTime");
    column.For(x => x.IsPaid ? "是" : "否").Named("是否已支付").SortColumnName("IsPaid");
    column.For(x => Html.F().GetPaymentInfo(x.PaymentKey)).Named("支付方式").SortColumnName("PaymentKey");
    column.For(x => Html.F().GetOrderSn(x.OrderId)).Named("订单号").SortColumnName("OrderId");
    column.For(x => Html.ActionLink(Html.F().GetUserName(x.UserId), "Index", "User", new {
                                        userid = x.UserId
                                    }, "")).Named("会员名称").SortColumnName("UserId");
    column.For(x => x.Money.ToMoney()).Named("付款单金额").SortColumnName("Money");
    column.For(x => x.Memo).Named("付款单备注").SortColumnName("Memo");
}).Complex(ViewData)
    <div class="grid_foot">
    </div>
</div>
<div class="blank5">
</div>
@Html.Pager(Model)

@if (!string.IsNullOrWhiteSpace(Request.Params["createTime"]))
{
    <div>
        当天总的成功支付金额：@(((decimal)ViewBag.TotalCharge).ToMoney()) &nbsp;&nbsp;&nbsp;
        当天总的成功支付笔数：@ViewBag.ChargeCount &nbsp;&nbsp;&nbsp;
        网银在线成功支付金额：@(((decimal)ViewBag.TotalChinaBank).ToMoney()) &nbsp;&nbsp;&nbsp;
        网银在线成功支付笔数：@ViewBag.ChinaBankCount &nbsp;&nbsp;&nbsp;
        银联在线成功支付金额：@(((decimal)ViewBag.TotalUnionPay).ToMoney()) &nbsp;&nbsp;&nbsp;
        银联在线成功支付笔数：@ViewBag.UnionPayCount
    </div>
}
